package cn.chencq.proxy.util;

import java.io.IOException;
import java.io.InputStream;
import java.util.Properties;

/**
 * Properties 文件解析
 * @author chencq
 *
 */
public class PropertiesUtils {

	public static Properties getProperties(String propertiesName) {
		InputStream inputStream = null;
		try {
			inputStream = Thread.currentThread().getContextClassLoader().getResourceAsStream(propertiesName);

			Properties properties = new Properties();
			properties.load(inputStream);

			return properties;
		} catch (Exception e) {
			e.printStackTrace();
			return null;
		} finally {
			try {
				if (null != inputStream) {
					inputStream.close();
				}
			} catch (IOException e) {
				e.printStackTrace();
			}
		}

	}

}
